﻿using System;
using System.Collections.Generic;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using AR.Entities;
using AR.ViewModels.Commands;
using System.Collections.ObjectModel;
using AR.Model;
using System.ServiceModel.DomainServices.Client;
using AR.Web;
using AR.CustomEntities;
using System.Windows.Navigation;

namespace AR.ViewModels
{
    public class EntretienTechniqueViewModel : ViewModelBase
    {
  
        private readonly CandidatModel model;
        private ObservableCollection<CANDIDAT> _candidats;
        public ObservableCollection<CANDIDAT> Candidats
        {
            get
            {
                return _candidats;
            }
            set
            {
                if (value != _candidats)
                {
                    _candidats = value;
                    OnPropertyChanged("Candidats");
                }
            }
        }
        public EntretienTechniqueViewModel()
        {
            model = new CandidatModel();
            Candidats = new ObservableCollection<CANDIDAT>();
            model.GetCandidats().EntityAdded += OnEntityAdded;


        }
       
        private void OnEntityAdded(object sender,
                                 EntityCollectionChangedEventArgs<CANDIDAT> entityCollectionChangedEventArgs)
        {
            Candidats.Add(entityCollectionChangedEventArgs.Entity);
        }
     
        public void getEnttechniqueCandidat(String Code)
        {
           // CandidatModel.SetDelegate(NavigateToEntTechnique);
           
        }
        
         public ICommand BegintestCommand
        {
            get
            {
                return new EntEcritCandidat(this);
            }
        }
        
    }
}
